#include "luaEvent.hpp"
#include "luaEventManager.hpp"

namespace lua
{

Event::Event(const char *name, Function callbackFunc) : 
	mName(name),
	mCallbackFunc(callbackFunc)
{
	EventManager::getInstance()->add(this);
}

Event* Event::add(const char *name, Function callbackFunc)
{
	return new Event(name, callbackFunc);
}

bool Event::remove(const char *name, Function callbackFunc)
{
	return EventManager::getInstance()->remove(name, callbackFunc);
}

bool Event::trigger(const char *eventName, Args args)
{
	return EventManager::getInstance()->trigger(eventName, args);
}

}